package o;

import java.util.Arrays;

public final class ali implements alc {
    private int ʼ;
    private aky[] ʽ;
    private final aky[] ˊ;
    private final boolean ˋ;
    private final int ˎ;
    private int ˏ;
    private final byte[] ॱ;
    private int ॱॱ;

    public ali(boolean z, int i) {
        this(z, i, 0);
    }

    public ali(boolean z, int i, int i2) {
        boolean z2;
        int i3 = 0;
        amm.ˊ(i > 0);
        if (i2 >= 0) {
            z2 = true;
        } else {
            z2 = false;
        }
        amm.ˊ(z2);
        this.ˋ = z;
        this.ˎ = i;
        this.ॱॱ = i2;
        this.ʽ = new aky[(i2 + 100)];
        if (i2 > 0) {
            this.ॱ = new byte[(i2 * i)];
            while (i3 < i2) {
                this.ʽ[i3] = new aky(this.ॱ, i3 * i);
                i3++;
            }
        } else {
            this.ॱ = null;
        }
        this.ˊ = new aky[1];
    }

    public synchronized void ॱ() {
        if (this.ˋ) {
            ˊ(0);
        }
    }

    public synchronized void ˊ(int i) {
        Object obj = i < this.ˏ ? 1 : null;
        this.ˏ = i;
        if (obj != null) {
            ˋ();
        }
    }

    public synchronized aky ˊ() {
        aky o_aky;
        this.ʼ++;
        if (this.ॱॱ > 0) {
            aky[] o_akyArr = this.ʽ;
            int i = this.ॱॱ - 1;
            this.ॱॱ = i;
            o_aky = o_akyArr[i];
            this.ʽ[this.ॱॱ] = null;
        } else {
            o_aky = new aky(new byte[this.ˎ], 0);
        }
        return o_aky;
    }

    public synchronized void ˋ(aky o_aky) {
        this.ˊ[0] = o_aky;
        ˎ(this.ˊ);
    }

    public synchronized void ˎ(aky[] o_akyArr) {
        if (this.ॱॱ + o_akyArr.length >= this.ʽ.length) {
            this.ʽ = (aky[]) Arrays.copyOf(this.ʽ, Math.max(this.ʽ.length * 2, this.ॱॱ + o_akyArr.length));
        }
        for (aky o_aky : o_akyArr) {
            aky[] o_akyArr2 = this.ʽ;
            int i = this.ॱॱ;
            this.ॱॱ = i + 1;
            o_akyArr2[i] = o_aky;
        }
        this.ʼ -= o_akyArr.length;
        notifyAll();
    }

    /* JADX WARNING: inconsistent code. */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public synchronized void ˋ() {
        /*
        r7 = this;
        r1 = 0;
        monitor-enter(r7);
        r0 = r7.ˏ;	 Catch:{ all -> 0x005e }
        r2 = r7.ˎ;	 Catch:{ all -> 0x005e }
        r0 = o.anr.ˎ(r0, r2);	 Catch:{ all -> 0x005e }
        r2 = 0;
        r3 = r7.ʼ;	 Catch:{ all -> 0x005e }
        r0 = r0 - r3;
        r3 = java.lang.Math.max(r2, r0);	 Catch:{ all -> 0x005e }
        r0 = r7.ॱॱ;	 Catch:{ all -> 0x005e }
        if (r3 < r0) goto L_0x0018;
    L_0x0016:
        monitor-exit(r7);
        return;
    L_0x0018:
        r0 = r7.ॱ;	 Catch:{ all -> 0x005e }
        if (r0 == 0) goto L_0x0061;
    L_0x001c:
        r0 = r7.ॱॱ;	 Catch:{ all -> 0x005e }
        r0 = r0 + -1;
    L_0x0020:
        if (r1 > r0) goto L_0x004b;
    L_0x0022:
        r2 = r7.ʽ;	 Catch:{ all -> 0x005e }
        r4 = r2[r1];	 Catch:{ all -> 0x005e }
        r2 = r4.ˊ;	 Catch:{ all -> 0x005e }
        r5 = r7.ॱ;	 Catch:{ all -> 0x005e }
        if (r2 != r5) goto L_0x002f;
    L_0x002c:
        r1 = r1 + 1;
        goto L_0x0020;
    L_0x002f:
        r2 = r7.ʽ;	 Catch:{ all -> 0x005e }
        r5 = r2[r0];	 Catch:{ all -> 0x005e }
        r2 = r5.ˊ;	 Catch:{ all -> 0x005e }
        r6 = r7.ॱ;	 Catch:{ all -> 0x005e }
        if (r2 == r6) goto L_0x003c;
    L_0x0039:
        r0 = r0 + -1;
        goto L_0x0020;
    L_0x003c:
        r6 = r7.ʽ;	 Catch:{ all -> 0x005e }
        r2 = r1 + 1;
        r6[r1] = r5;	 Catch:{ all -> 0x005e }
        r5 = r7.ʽ;	 Catch:{ all -> 0x005e }
        r1 = r0 + -1;
        r5[r0] = r4;	 Catch:{ all -> 0x005e }
        r0 = r1;
        r1 = r2;
        goto L_0x0020;
    L_0x004b:
        r0 = java.lang.Math.max(r3, r1);	 Catch:{ all -> 0x005e }
        r1 = r7.ॱॱ;	 Catch:{ all -> 0x005e }
        if (r0 >= r1) goto L_0x0016;
    L_0x0053:
        r1 = r7.ʽ;	 Catch:{ all -> 0x005e }
        r2 = r7.ॱॱ;	 Catch:{ all -> 0x005e }
        r3 = 0;
        java.util.Arrays.fill(r1, r0, r2, r3);	 Catch:{ all -> 0x005e }
        r7.ॱॱ = r0;	 Catch:{ all -> 0x005e }
        goto L_0x0016;
    L_0x005e:
        r0 = move-exception;
        monitor-exit(r7);
        throw r0;
    L_0x0061:
        r0 = r3;
        goto L_0x0053;
        */
        throw new UnsupportedOperationException("Method not decompiled: o.ali.ˋ():void");
    }

    public synchronized int ˎ() {
        return this.ʼ * this.ˎ;
    }

    public int ˏ() {
        return this.ˎ;
    }
}
